{if !empty($menus)}
<select name="parents[]" onchange="getChildMenu('container',this)">
    <option value="0">无</option>
    {foreach $menus as $menu}
    {if $menu.isdir eq 1}
    <option value="{$menu.id}">{$menu.menu_name}</option>
    {/if}
    {/foreach}
</select>
{/if}

<script type="text/javascript">
$('#groups').html('');
{if $pid eq 0 || ($pid > 0 && $groupids eq 0)}
$('#groups').append('<p style="width:100%;height:20px;border-bottom:dashed 1px blue;padding-bottom:5px;margin-bottom:5px;"><input type="checkbox" name="open" value="1"{if $pid > 0 && $groupids eq 0} checked{/if} style="vertical-align:middle;"/><span style="line-height:20px;padding-left:2px;">不限</span><span style="color:red;">[勾选此处后虚线下方的选项将被忽略]</span></p>');
{foreach $groups as $groupid => $group}
$('#groups').append('<input type="checkbox" name="groups[]" value="{$groupid}" style="vertical-align:middle;"/><span style="color:blue;padding-left:4px;">{$groups[$groupid].groupname}</span>');
{/foreach}
{else}
{foreach $groupids as $id}
$('#groups').append('<input type="checkbox" name="groups[]" value="{$id}" checked style="vertical-align:middle;"><span style="padding-left:4px;color:blue;">{$groups[$id].groupname}</span>');
{/foreach}
{/if}
</script>